package com.skyworth.web.table;


import com.skyworth.web.admin.table.model.TableModel;
import com.skyworth.web.admin.table.service.ITableService;
import com.skyworth.web.common.controller.BaseController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by cody on 2016/8/11.
 */

@Controller
public class ApiTableController extends BaseController {

    Logger LOG = LoggerFactory.getLogger(ApiTableController.class);

    @Autowired
    private ITableService iTableService;


    @ResponseBody
    @RequestMapping(value = "/api/table/storeid/{storeid}",method = RequestMethod.GET)
    public Iterable<TableModel> queryByStoreId(@PathVariable("storeid") long storeId){
        return iTableService.queryByStoreId(storeId);
    }

    @ResponseBody
    @RequestMapping(value = "/api/table/managerid/{managerid}",method = RequestMethod.GET)
    public Iterable<TableModel> queryByManagerId(@PathVariable("managerid") long id){
        return iTableService.queryByManagerId(id);
    }

}
